import { BasicColumn, FormSchema } from '@/components/Table';

const enableOptions = [
  { label: '启用', value: 1 },
  { label: '停用', value: 0 },
];

export const tableColumns: BasicColumn[] = [
  { title: '编号', dataIndex: 'id' },
  { title: '所属大类', dataIndex: 'category' },
  { title: '盒型名称', dataIndex: 'name' },
  { title: '示例图', dataIndex: 'img' },
  { title: '状态', dataIndex: 'enable' },
];
export const tableFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '盒型名称',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'category',
    label: '所属大类',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: [],
    },
  },
  {
    field: 'enable',
    label: '状态',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: enableOptions,
    },
  },
];

export const modalFormSchema: FormSchema[] = [
  {
    required: true,
    field: 'category',
    label: '所属大类',
    component: 'Select',
    componentProps: {
      options: [],
    },
  },
  {
    required: true,
    field: 'name',
    label: '产品名称',
    component: 'Input',
  },
  {
    required: true,
    field: 'img',
    label: '示例图',
    component: 'ImageUpload',
    componentProps: {
      maxNumber: 1,
    },
  },
];
